#!/bin/sh
pod2html drsync.pl >drsync.html
perl -e '
	use dTemplate;
	use Class::Date qw(now);
	$mainpage = define dTemplate "index.htm";
	open FILE, "DRSync.pm" or die "Cannot open DRSync.pm";
	while (<FILE>) {
		if (/\$VERSION\s+\=/) {
			eval $_;
			last;
		}
	};
	close FILE;
	open CHANGELOG, "Changes" or die "Cannot open Changes";
	$/ = undef;
	$CHANGELOG = <CHANGELOG>;
	open TARGET, ">index.html" or die "Cannot open index.html for writing";
	print TARGET $mainpage->parse(
		date		=> now,
		version		=> $VERSION,
		CHANGELOG	=> $CHANGELOG,
	);
	close TARGET;
';
cd ..
tar cvzf drsync/drsync.tgz drsync/index.html drsync/drsync.html drsync/drsync.pl drsync/install.pl drsync/Getopt/Mixed.pm drsync/DRSync.pm drsync/Changes
